package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.BindExchangeBean;
import com.lianzhihui.romeex.bean.ExchangeFindHomeBean;
import com.lianzhihui.romeex.bean.FindExchangeInfoBean;
import com.lianzhihui.romeex.bean.UserInfoBean;
import com.lianzhihui.romeex.mvp.model.BindRomeexModelImp;
import com.lianzhihui.romeex.mvp.model.BindRomeexModelInterface;
import com.lianzhihui.romeex.mvp.view.BindRomeexView;

//逻辑实现
public class BindRomeexPresnterImp implements BindRomeexModelInterface {

    private final BindRomeexView viewLayer;
    private final BindRomeexModelImp modelImp;

    public BindRomeexPresnterImp(Context context, BindRomeexView viewLayer) {
        this.viewLayer = viewLayer;
        modelImp = new BindRomeexModelImp(context, this);
    }

    public void requestBindExchange(String exchangeUID, String verifyId, String verifyCode, String phone) {
        modelImp.requestBindExchange(exchangeUID, verifyId, verifyCode, phone);
    }

    public void requestFindExchangeInfo(String exchangeUID, String phone) {
        modelImp.requestFindExchangeInfo(exchangeUID, phone);
    }

    public void requestExchangeFindHome() {
        modelImp.requestExchangeFindHome();
    }
 public void requestExchangeReFlashExchangeFlow() {
        modelImp.requestExchangeReFlashExchangeFlow();
    }


    @Override
    public void responseSuccess(BindExchangeBean bean) {
        viewLayer.success(bean);
    }

    @Override
    public void responseFindExchangeInfoSuccess(FindExchangeInfoBean bean) {
        viewLayer.responseFindExchangeInfoSuccess(bean);
    }

    @Override
    public void responseExchangeFindHomeSuccess(ExchangeFindHomeBean bean) {
        viewLayer.responseExchangeFindHomeSuccess(bean);
    }

    @Override
    public void ExchangeReFlashExchangeFlow(ExchangeFindHomeBean bean) {
        viewLayer.ExchangeReFlashExchangeFlow(bean);
    }

    @Override
    public void onFailure() {
        viewLayer.setFailure();
    }
}
